package com.mbc.common.entities;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

@SuppressWarnings("serial")
@Entity
@Table(name="Users")
@NamedQueries({
	@NamedQuery(name="User.findByLoginId", query="SELECT u FROM User u WHERE u.loginId = :loginId")
})
public class User implements Serializable {

	@Id
	private long userId;
	@Basic(optional=false)
	private String userName;
	@Basic(optional=false)
	private String loginId;
	@Basic(optional=false)
	private String password;
	private byte status;
	private String module;
	private Date createdDate;
	private long createdBy;
	private Date updatedDate;
	private long updatedBy;
	private String email;
	private Date latestLoginDateTime;
	
	@Transient
	private List<UserInRoles> userInRolesList = new ArrayList<UserInRoles>();
	
	@Transient
	private List<UserInBranches> userInOfficeList = new ArrayList<UserInBranches>();

	public User(){
	}
	
	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getLoginId() {
		return loginId;
	}

	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public byte getStatus() {
		return status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	public String getModule() {
		return module;
	}

	public void setModule(String module) {
		this.module = module;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public long getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(long createdBy) {
		this.createdBy = createdBy;
	}

	public Date getUpdatedDate() {
		return updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public long getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(long updatedBy) {
		this.updatedBy = updatedBy;
	}

	public List<UserInRoles> getUserInRolesList() {
		return userInRolesList;
	}

	public void setUserInRolesList(List<UserInRoles> userInRolesList) {
		this.userInRolesList = userInRolesList;
	}

	public List<UserInBranches> getUserInOfficeList() {
		return userInOfficeList;
	}

	public void setUserInOfficeList(List<UserInBranches> userInOfficeList) {
		this.userInOfficeList = userInOfficeList;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getLatestLoginDateTime() {
		return latestLoginDateTime;
	}

	public void setLatestLoginDateTime(Date latestLoginDateTime) {
		this.latestLoginDateTime = latestLoginDateTime;
	}

}
